import Vue from 'vue';
import VueRouter from 'vue-router';
import AuthorsList from '@/views/AuthorsList.vue';
import AuthorDetail from '@/views/AuthorDetail.vue';
import Profile from '@/views/Profile.vue';

Vue.use(VueRouter);

const routes = [
  { path: '/login', name: 'login', component: () => import('../views/Login.vue') },
  { path: '/', name: 'home', component: () => import('../views/Home.vue') },
  { path: '/works/:id', name: 'WorksDetail', component: () => import('../views/WorksDetail.vue') },
  { path: '/chapter/:id', name: 'ChapterDetail', component: () => import('../views/ChapterDetail.vue') },
  {
    path: '/authors',
    name: 'AuthorsList',
    component: AuthorsList
  },
  {
    path: '/authors/:authorId',
    name: 'AuthorDetail',
    component: AuthorDetail
  },
  {
    path: '/profile',
    name: 'profile',
    component: Profile
  },
];

const router = new VueRouter({
  routes
});

export default router;
